package com.ponhu.ea2.enums;

/**
 * 适用人群枚举
 *
 * @author Wang
 * @date 2021/11/20 10:30 上午
 */
public enum ApplyCrowdEnum {
    ALL(1, "所有人"),
    MAN(2, "男士"),
    WOMAN(3, "女士"),
    ;

    private Integer code;

    private String name;

    ApplyCrowdEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getName(Integer code) {
        if (code == null) {
            return null;
        }
        for (ApplyCrowdEnum c : ApplyCrowdEnum.values()) {
            if (code.equals(c.getCode())) {
                return c.name;
            }
        }
        return null;
    }
}
